package poker.controller;

import poker.guimodel.UIState;
import poker.model.GameBean;
import at.ac.tuwien.big.easyholdem.player.DerbyPlayerDAO;

public class LoggedInController 
{
	private DerbyPlayerDAO derbyPlayerDAO;
	private UIState currentView;
	private GameBean gameBean;

	public String logout()
	{		
		derbyPlayerDAO.update(gameBean.getPlayer());
		currentView.setCurrentView(UIState.State.WELCOME);
		
		return "logout";
	}
	
	public String editForm()
	{
		return "editForm";
	}
	
	public String edit()
	{			
		derbyPlayerDAO.update(gameBean.getPlayer());
		
		return "edit";
	}

	public GameBean getGameBean() {
		return gameBean;
	}

	public void setGameBean(GameBean gameBean) {
		this.gameBean = gameBean;
	}
	
	public DerbyPlayerDAO getDerbyPlayerDAO() {
		return derbyPlayerDAO;
	}

	public void setDerbyPlayerDAO(DerbyPlayerDAO derbyPlayerDAO) {
		this.derbyPlayerDAO = derbyPlayerDAO;
	}

	public UIState getCurrentView() {
		return currentView;
	}

	public void setCurrentView(UIState currentView) {
		this.currentView = currentView;
	}

}
